package com.tuanzi.blog.service;

import com.tuanzi.blog.model.Blog;
import com.tuanzi.blog.model.BlogWithBLOBs;

import java.util.List;
import java.util.Map;

/**
 * 守得云开见月明
 */

public interface BlogService {

    BlogWithBLOBs getBlog(Long id);

    //查询所有博客
    List<BlogWithBLOBs> getAllBlogs();

    //指定条件查询
    List<BlogWithBLOBs> list(BlogWithBLOBs blog);

    int saveBlog(BlogWithBLOBs blog);

    BlogWithBLOBs deleteBlog(Long id);

    //根据类型查询
    List<BlogWithBLOBs> getTypeBlogs(Long id);


    List<BlogWithBLOBs> getTimeBlogs(int size);

    /**
     * 全局搜索，内容或者标题中含有和这个字段的博客列表
     * @return
     */
    List<BlogWithBLOBs> searchBlogByTitleOrContent(String title);

    //归档查询
    Map<String,List<BlogWithBLOBs>> archiveBlogs();

    //查询博客数量
    Long countBlog();


}
